package cn.ren.service;

import cn.ren.dao.Rp_memberDao;
import cn.ren.entity.PageResult;
import cn.ren.entity.QueryPageBean;
import cn.ren.pojo.Member;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @program: exercise_health
 * @description:
 * @author: ren
 * @create: 2020-03-11 20:19
 **/
@Service(interfaceClass = Rp_memberService.class)
@Transactional
public class Rp_memberServiceImpl implements Rp_memberService {
    @Autowired
    private Rp_memberDao rp_memberDao;

    @Override
    public PageResult findByCondition(QueryPageBean queryPageBean) {
        PageHelper.startPage(queryPageBean.getCurrentPage(),queryPageBean.getPageSize());
        Page<Member> list = rp_memberDao.findByCondition(queryPageBean.getQueryString());
        return new PageResult(list.getTotal(),list.getResult());
    }
}
